/*
 * iothread.h
 *
 *  Created on: 2011-8-16
 *      Author: chenl
 *     Purpose:
 *        Note:
 */

#ifndef IOTHREAD_H_
#define IOTHREAD_H_

#include "common/common_thread.h"
#include "common/common_connect.h"
#include "serialport.h"
#include "tcpserver.h"

#define MAX_FD 1024 - 1

class CIOThread : public CThread
{
public:
	CIOThread();
	virtual ~CIOThread();
public:
	virtual void Execute();
protected:
	int TryCleanClientPool();
private:
	CTcpServer m_tcpServer;
	unsigned int m_nClientCount;
	CSerialPort m_sensor;
	CConnect *m_arrClientPool[MAX_FD];
};

#endif /* IOTHREAD_H_ */
